import { existsSync } from 'fs'
import { red, yellow } from 'chalk'

/**
 * 检查项目是否存在
 * @param dir 
 * @param name 
 */
export function checkDir(dir: string, name: string) {
    let isExists = existsSync(dir);
    if (isExists) {
        console.log(
            red('项目:'),
            yellow(name),
            red('已存在当前目录中!')
        );
        process.exit(1);
    }
};